//前端service层

app.service('brandService',function ($http) {

    //查询所有商品分类
    this.findAll=function () {
        return $http.get('../brand/findAll.do');
    }

    //查询所有商品分类(分页)
    this.findPage=function (page,size) {
        return $http.get('../brand/findPage.do?pageNum=' + page + '&pageSize=' + size);
    }

    //新增商品分类
    this.add=function (entitys) {
        return $http.post('../brand/add.do', entitys);
    }

    //修改商品分类
    this.update=function (entitys) {
        return $http.post('../brand/update.do', entitys);
    }

    //查寻商品类别
    this.findOne=function (id) {
        return $http.get('../brand/findOne.do?id=' + id);
    }

    //删除商品类别
    this.delet=function (ids) {
        return $http.get('../brand/delete.do?ids=' + ids);
    }

    //全局条件查询
    this.search=function (entity ,page, size) {
        return $http.post('../brand/search.do?pageNum=' + page + '&pageSize=' + size, entity);
    }
});